package com.wn.icloud.configuration;

import com.wn.icloud.common.handler.GlobalExceptionHandler;
import com.wn.icloud.provider.AuditorProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

/**
 * @author kyy
 * @date 2019/04/22
 */
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
@Configuration
public class ProviderConfiguration {

    @Bean
    GlobalExceptionHandler getGlobalExceptionHandler() {
        return new GlobalExceptionHandler();
    }

    @Bean("auditorAware")
    AuditorProvider AuditorProvider() {
        return new AuditorProvider();
    }


}
